﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spring.Context;
using Spring.Context.Support;

namespace IOCSolution.Spring
{
    public class SpringRunner : IRunner
    {
        private IApplicationContext _context;

        public string Name
        {
            get { return "Spring"; }
        }

        public void Init()
        {
            _context = ContextRegistry.GetContext();
        }

        public void Start()
        {
            Console.WriteLine("\r\nthis name: " + Name);
            var manager = (DatabaseHelper)_context.GetObject("DatabaseHelper");
            manager.Search("select * from users");
        }
    }
}
